<%@ page contentType="text/html;charset=UTF-8" %>

<g:if test="${!session.hotels}">
  No Hotels Found
</g:if>
<g:else>
  <table>
    <thead>
    <tr>
      <th scope="col">Name</th>
      <th scope="col">Address</th>
      <th scope="col">City, State</th>
      <th scope="col">Zip</th>
      <th scope="col">Action</th>
    </tr>
    </thead>
    <tbody>
    <g:each in="${session.hotels}" var="hotel">
      <tr>
        <td>${hotel.name}</td>
        <td>${hotel.address}</td>
        <td>${hotel.city}, ${hotel.state}</td>
        <td>${hotel.zip}</td>
        <td>
          <g:link controller="booking" action="bookingHotel" id="${hotel.id}">View Hotel</g:link>
        </td>
      </tr>
    </g:each>
    </tbody>
  </table>
  <g:remotePaginate total="${session.hotelCount}" max="${session.max}" offset="${session.offset}" update="searchResults" action="search" />
</g:else>